import request from '@/utils/request'

// 查询bom模型列表
export function listMaterialCount(query) {
  return request({
    url: '/system/count/list',
    method: 'get',
    params: query
  })
}

export function listMaterialCount2(query) {
  return request({
    url: '/system/count/treeselect',
    method: 'get',
    params: query
  })
}

// 查询bom模型详细
export function getMaterialCount(id) {
  return request({
    url: '/system/count/' + id,
    method: 'get'
  })
}

// 新增bom模型
export function addMaterialCount(data) {
  return request({
    url: '/system/count',
    method: 'post',
    data: data
  })
}

// 修改bom模型
export function updateMaterialCount(data) {
  return request({
    url: '/system/count',
    method: 'put',
    data: data
  })
}

// 删除bom模型
export function delBomCost(id) {
  return request({
    url: '/system/bomCost/' + id,
    method: 'delete'
  })
}

// 获取root
export function getroot(query) {
  return request({
    url: '/system/count/getroot',
    method: 'get',
    params: query
  })
}

// 获取子节点
export function getchildren(query) {
  return request({
    url: '/system/count/getchildren',
    method: 'get',
    params: query
  })
}

//导出
export function handleExport(query) {
  return request({
    url: '/system/bomCost/export',
    method: 'post',
    params: query
  })
}
